package fit.glike.net.domain;

import lombok.Data;

import java.util.Objects;

@Data
public class Device {

    /**
     * ip地址
     */
    private String ipAddress;
    /**
     * mac地址
     */
    private String macAddress;
    private String name;

    public Device() {
    }

    public Device(String ipAddress, String macAddress) {
        this.ipAddress = ipAddress;
        this.macAddress = macAddress;
    }

    public Device(String ipAddress, String macAddress, String name) {
        this.ipAddress = ipAddress;
        this.macAddress = macAddress;
        this.name = name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Device device = (Device) o;
        return ipAddress.equals(device.ipAddress) && macAddress.equals(device.macAddress);
    }

    @Override
    public int hashCode() {
        return Objects.hash(ipAddress, macAddress);
    }

    @Override
    public String toString() {
        return "Name: " + name + "IP Address: " + ipAddress + ", MAC Address: " + macAddress;
    }

}
